<template>
    <div class="land-archives">
        <!-- 地图容器 -->
        <div id="promotionMap" style="width:100%;height:100%;"></div>

       
    </div>
</template>

<script setup>
let map = null;

// 初始化
function initMap() {
    let mapTimer = setInterval(() => {
        if (window.aMapLoaded) {
            clearInterval(mapTimer);
            mapTimer = null;

            map = new AMap.Map('promotionMap', {
                center: [106.886, 32.59],
                zoom: 10,
                mapStyle: "amap://styles/whitesmoke"
            });

            map.on('complete', () => {

            })
        }
    }, 100);
}

onMounted(() => {
    // 清除地图数据
    map && (map = undefined);

    // 注意：异步回调函数的声明应该在 JSAPI 引入之前，函数名与callback=onLoad中对应
    initMap();
})
</script>

<style lang="scss" scoped>
.land-archives {
    position: relative;
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

</style>